package tgc.edu.exam.repository;

import java.util.List;
import java.util.UUID;

import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import tgc.edu.exam.custom.CommonRepository;
import tgc.edu.exam.entity.Student;
import tgc.edu.exam.entity.TbClass;
@Repository
public interface StudentRepository extends CommonRepository<Student, UUID>{

	public Student findByUsername(String idcode);

	public List<Student> findByTbClassId(UUID id);

	@Query(value="from Student s where s.tbClass = ?1 order by s.workUnit, s.sex, s.nation")
	public List<Student> Grouping(TbClass tbCl);

	public List<Student> findByTbClassId(Sort by, UUID id);

	public List<Student> findByTbClassIdAndIsUsed(UUID fromString, boolean b);

	//public List<Student> findByTbClassIdOrderByWorkUnitSexNation(UUID id, String string, String string2, String string3);

	//public List<Student> findByTbClassIdAndSort(UUID id, Sort sort);

}
